package com.thoughtworks;

import java.util.ArrayList;

public class Analysis {

    public String[] returnIds(String selectedItems){
        String[] selected = selectedItems.split(",");
        String[] selectedIds = new String[selected.length];
        for(int i=0;i<selected.length;i++){
            selectedIds[i] = selected[i].split(" x ")[0];
        }
        return selectedIds;
    }

    public int[] returnNumbers(String selectedItems){
        String[] selected = selectedItems.split(",");
        int[] selectedNumbers = new int[selected.length];
        for(int i=0;i<selected.length;i++){
            selectedNumbers[i] = Integer.parseInt(selected[i].split(" x ")[1]);
        }
        return selectedNumbers;
    }

}
